program example
    use stdlib_logger
    character(*), parameter :: filename = 'dummy.txt'
    integer :: iostat, lun
    character(128) :: iomsg
    character(*), parameter :: message = 'Failure in opening "dummy.txt".'

    open (newunit=lun, file=filename, form='formatted', &
          status='old', iostat=iostat, iomsg=iomsg)
    if (iostat /= 0) then
        call global_logger%log_io_error(message, procedure='EXAMPLE', &
                                        iostat=iostat, iomsg=iomsg)
    end if
end program example
